package worktools;

import worktools.utils.DbUtils;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

/**
 * Created by bearworker on 17-4-5.
 */
public class TestConn {

    public static void main(String args[]){
        try {
            DbUtils dbUtils = new DbUtils(true,null);
            for (int i=0;i<1000;i++) {
                Connection conn = dbUtils.getConnByPool();

                Statement st = conn.createStatement();
                ResultSet resultSet = st.executeQuery("select now()");
                while (resultSet.next()) {
                    System.out.println(resultSet.getString(1));
                }
                dbUtils.closeConn(conn);
                Thread.sleep(1000);
            }

        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
